// import React from "react";
import React from "./react";

class Counter extends React.Component{
    constructor(props){
        super(props)
        this.a = React.createRef() // {current:null}
        this.b = React.createRef()
        this.result = React.createRef()

    }
    add(event){
     let a = this.a.current.value
     let b = this.b.current.value
     this.result.current.value = a + b
    }
    parentHandle(){
        console.log('parentHandle');
    }
    render(){
        return (<div>
         <input ref={this.a} />
         <input ref={this.b} />
         <button onClick={this.add.bind(this)}>=</button>
         <input ref={this.result} />
        </div>)
    }
}

export default Counter